package com.yuanyi.changyihao;

import com.yuanyi.changyihao.util.AccessTokenUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.io.IOException;

@SpringBootApplication
public class ChangyihaoApplication {

    public static void main(String[] args) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                while (true) {
                    try {
                        AccessTokenUtil.findAccessToken();
                        Thread.sleep(1000 * 60 * 60 * 2);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
        });
        SpringApplication.run(ChangyihaoApplication.class, args);
    }

}
